package com.zhouyu.exampleThread.threadTest;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:线程通信
 */
public class CountingStar {
  volatile private List<Integer> list = new ArrayList<>();

  public void add() {
    list.add(1);
  }
  public void remove(){
    list.remove(0);
  }

  public int size() {
    return list.size();
  }
}
